package com.wang.work;

import java.io.File;

public class DeleteTest {

	public static void main(String[] args) {
//		File file = new File("F:/test");
//		System.out.println(deleteAll(file));
	}
	public static boolean deleteAll(File file){
		if(file == null || file.exists()) return false;
		if(file.isFile()){
			return file.delete();
		}else{
			File[] listFiles = file.listFiles();
			for (int i = 0; i < listFiles.length; i++) {
				return deleteAll(listFiles[i]);
			}
			return true;
		}
	}
}
